home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / obsolete / rgb_to_hsv.pro < prev    next >
Text File  |  1997-07-08  |  2KB  |  68 lines

  1. ; $Id: rgb_to_hsv.pro,v 1.2 1997/01/15 04:02:19 ali Exp $
  2. ;
  3. ; Copyright (c) 1989-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. pro rgb_to_hsv, red, green, blue, h, s, v
  7. ;+
  8. ; NAME:
  9. ;    RGB_TO_HSV
  10. ;
  11. ; PURPOSE:
  12. ;    Convert from the RGB (Red, Green, Blue) color system to the
  13. ;    HSV (Hue, Saturation, Value) color system.
  14. ;
  15. ;    Note that this procedure has essentially been replaced by
  16. ;    the much quicker built-in routine COLOR_CONVERT.
  17. ;
  18. ; CATEGORY:
  19. ;    Graphics, color systems.
  20. ;
  21. ; CALLING SEQUENCE:
  22. ;    RGB_TO_HSV, Red, Green, Blue, H, S, V
  23. ;
  24. ; INPUTS:
  25. ;    Red:    Red color value(s), may be scalar or vector.  RGB values
  26. ;        are in the range 0 to 255.
  27. ;
  28. ;    Green:    Green color value(s), must have the same number of elements
  29. ;        as Red.
  30. ;
  31. ;    Blue:    Blue color value(s), must have the same number of elements
  32. ;        as Red and Green.
  33. ;
  34. ; OUTPUTS:
  35. ;    H:    Hue output.  This vector has the same number of elements as 
  36. ;        Red.  Hue is in the range of [0,360).  H is 0 (should really 
  37. ;        be undefined) if S (Saturation) is 0.0, 
  38. ;        i.e., red == green == blue.
  39. ;
  40. ;    S:    Saturation output, in the range of [0,1].
  41. ;
  42. ;    V:    Value output, in the range of [0,1].
  43. ;
  44. ; COMMON BLOCKS:
  45. ;    None.
  46. ;
  47. ; SIDE EFFECTS:
  48. ;    None.
  49. ;
  50. ; RESTRICTIONS:
  51. ;    Red, Green, and Blue should be scaled into the range 0 to 255.
  52. ;
  53. ; PROCEDURE:
  54. ;    Taken from Foley & Van Dam, Fundamentals of Interactive Computer
  55. ;    Graphics, 1982. Pg 615.
  56. ;
  57. ; MODIFICATION HISTORY:
  58. ;    DMS, Aug, 1989.
  59. ;    DMS,     Changed to use COLOR_CONVERT (Which really makes
  60. ;        this procedure obsolete.)
  61. ;-
  62.  
  63. on_error,2                              ;Return to caller if an error occurs
  64. color_convert, red, green, blue, h, s, v, /RGB_HSV
  65. end
  66.  
  67.  
  68.